package demo;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

/**
 * Created with IntelliJ IDEA.
 * Description: 使用write进行写入
 * Author:  LiuTao
 * Version: 1.0
 * Date:    2024-03-27  19:30
 */
public class IODemo10 {
    public static void main(String[] args) throws FileNotFoundException {
        try(OutputStream outputStream = new FileOutputStream("./text.txt",true)) {  //append 不将里面内容清空
            byte[] buffer = new byte[]{97,98,99,100};
            outputStream.write(buffer);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
